home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 1_0-2 / EARTHPLO / EP_SETOP.C < prev   
C/C++ Source or Header  |  1987-09-29  |  2KB  |  101 lines

  1. #include "ep.const.h"
  2. #include "ep.extern.h"
  3. #include "DialogMgr.h"
  4.  
  5. setOptions()
  6. {
  7.     DialogPtr    optionsDialogPtr;
  8.     int            itemHit;
  9.     Rect    junkRect;
  10.     int        tempKind;
  11.  
  12. ControlHandle
  13.     pictButton,        /* options dialog items */
  14.     bitmapButton,
  15.     intButton, 
  16.     fpButton,
  17.     hiddenlineBox,
  18.     lnlBox,
  19.     squareBox;
  20.  
  21. int
  22.     tpictButton,        /* options dialog items */
  23.     tbitmapButton,
  24.     tintButton,
  25.     tfpButton,
  26.     thiddenlinesBox,
  27.     tlnlBox,
  28.     tsquareBox;
  29.  
  30.     tpictButton        = npictButton;
  31.     tbitmapButton    = nbitmapButton;
  32.     tintButton        = nintButton;
  33.     tfpButton        = nfpButton;
  34.     thiddenlinesBox    = nhiddenlinesBox;
  35.     tlnlBox            = nlnlBox;
  36.     tsquareBox        = nsquareBox;
  37.  
  38.     optionsDialogPtr = GetNewDialog (200, 0L, (long) -1);
  39.     GetDItem(optionsDialogPtr,2,&tempKind,&pictButton,&junkRect);
  40.     GetDItem(optionsDialogPtr,3,&tempKind,&bitmapButton,&junkRect);
  41.     GetDItem(optionsDialogPtr,9,&tempKind,&intButton,&junkRect);
  42.     GetDItem(optionsDialogPtr,8,&tempKind,&fpButton,&junkRect);
  43.     GetDItem(optionsDialogPtr,5,&tempKind,&lnlBox,&junkRect);
  44.     GetDItem(optionsDialogPtr,13,&tempKind,&hiddenlineBox,&junkRect);
  45.     GetDItem(optionsDialogPtr,6,&tempKind,&squareBox,&junkRect);
  46.     
  47.     do {
  48.         SetCtlValue(pictButton,tpictButton);
  49.         SetCtlValue(bitmapButton,tbitmapButton);
  50.         SetCtlValue(intButton,tintButton);
  51.         SetCtlValue(fpButton,tfpButton);
  52.         SetCtlValue(hiddenlineBox,thiddenlinesBox);
  53.         SetCtlValue(lnlBox,tlnlBox);
  54.         SetCtlValue(squareBox,tsquareBox);
  55.     
  56.         ModalDialog (0L, &itemHit);
  57.         
  58.         switch (itemHit) {
  59.         case 2:                        /* "picture" */
  60.             tpictButton   = 1;
  61.             tbitmapButton = 0;
  62.             break;
  63.         case 3:                        /* "bitmap" */
  64.             tpictButton   = 0;
  65.             tbitmapButton = 1;
  66.             break;
  67.         case 9:                     /* "integer" */
  68.             tintButton        = 1;
  69.             tfpButton        = 0;
  70.             break;
  71.         case 8:                     /* "floating point" */
  72.             tintButton        = 0;
  73.             tfpButton        = 1;
  74.             break;
  75.         case 13:                        /* "use hidden lines" */
  76.             thiddenlinesBox    = (thiddenlinesBox) ? 0 : 1;
  77.             break;
  78.         case 5:                        /* "draw lat & long" */
  79.             tlnlBox            = (tlnlBox) ? 0 : 1;
  80.             break;
  81.         case 6:                        /* "draw lat & long" */
  82.             tsquareBox        = (tsquareBox) ? 0 : 1;
  83.             break;
  84.         }
  85.     
  86.     } while ((itemHit != 1/* OK */) && (itemHit != 12/* CANCEL */));
  87.  
  88.     DisposDialog(optionsDialogPtr);
  89.  
  90.     if (itemHit == 1) {
  91.         npictButton        = tpictButton;
  92.         nbitmapButton    = tbitmapButton;
  93.         nintButton        = tintButton;
  94.         nfpButton        = tfpButton;
  95.         nhiddenlinesBox    = thiddenlinesBox;
  96.         nlnlBox            = tlnlBox;
  97.         nsquareBox        = tsquareBox;
  98.     }
  99. }
  100.  
  101.